//
//  UIAlertView+Kirinrin.m
//  YouMe
//
//  Created by Kirinrin on 14/9/18.
//  Copyright (c) 2014年 suplus. All rights reserved.
//

#import "UIAlertView+Kirinrin.h"
#import "AppDelegate.h"


@implementation UIAlertView (Kirinrin)
+ (void) alertWithTitle:(NSString *)title message:(NSString *)message{
    UIAlertView*alert = [[UIAlertView alloc] initWithTitle:title  message:message delegate:self cancelButtonTitle:@"好的" otherButtonTitles:nil];
    
    [alert show];
}

+ (void) alertWithMessage:(NSString *)message{
    [UIAlertView alertWithTitle:nil message:message];
}

+ (void) alertWithRemoteError:(WSResult)errorCode{
    NSString *alertTitle;
    NSString *alertMessage;
    
    switch (errorCode) {
        
        case WSResultCommonError:
        
        default:{
            NSLog(@"未处理的错误代码 code = %d", errorCode);
            alertTitle = NSLocalizedString(@"提示", nil);
            alertMessage = [NSString stringWithFormat:NSLocalizedString(@"非常抱歉，遇到了未知错误，请稍后再试！error code = %u", nil), errorCode] ;
            break;
        }
            
            break;
    }
    
    [self alertWithTitle:alertTitle message:alertMessage];
}

+ (void) alertWithNetworkError{
    [self alertWithMessage:@"网络故障。"];
}

+ (void) alertWithFormCheckError:(FCError)errorCode{
    switch (errorCode) {
        case FCErrorInvaildFormat:
            
            break;
            
        default:
            break;
    }
}
@end
